import java.util.*;


public class Solution2 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 
     * @param firstList int整型二维数组 
     * @param secondList int整型二维数组 
     * @return int整型二维数组
     */
    public static int[][] findIntersection (int[][] firstList, int[][] secondList) {
        // write code here
        int min = firstList[0][0] < secondList[0][0]? firstList[0][0] : secondList[0][0];
        int max = firstList[firstList.length-1][1] < secondList[secondList.length-1][1]? firstList[firstList.length-1][1] : secondList[secondList.length-1][1];
        HashMap<Integer,Integer> set = new HashMap<>();
        int i = 0;//1队
        int j = 0;//2队
        for(int k = min;k<=max && i < firstList.length && j < secondList.length;k++){
            if(k >= firstList[i][0] && k <= firstList[i][1]
            && k >= secondList[j][0] && k <= secondList[j][1]){
                set.put(k,1);
            }
            if(k == firstList[i][1]){
                i++;
            }
            if(k == secondList[j][1]){
                j++;
            }
        }
        HashMap<Integer,Integer> map = new HashMap<>();
        int start = 0;
        int end = 0;
        for(int k = min;k<=max;k++){
            if(set.get(k) != null){
                start = k;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        int[][] arr1 = {{0,3},{5,9},{11,13}};
        int[][] arr2 = {{2,6},{8,10}};
        findIntersection(arr1, arr2);
    }
}